<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        *{
            margin: 0;
            padding: 0;
        }
        .box{
            width: 450px;
            height: 600px;
            border: 3px solid;
            margin: 50px;

            position: relative;
        }
        .box .show{
            width: 450px;
            height: 450px;

            position: relative;
        }
        .box .show img{
            width: 100%;
            height: 100%;
            display: block;
        }
        .box .show .mask{
            width: 200px;
            height: 200px;

            /* 让事件穿过蒙版 */
            pointer-events: none;

            position: absolute;
            top: 0;
            left: 0;
            background-color: springgreen;
            opacity: .5;
        }
        .box .list{
            width: 450px;
            height: 150px;
            border-top: 3px solid;

            display: flex;
            justify-content: space-evenly;
            align-items: center;
        }
        .box .list p{
            width: 50px;
            height: 50px;
            border: 2px solid;
        }
        .box .list p.active{
            border:2px solid springgreen
        }
        .box .list p img{
            width: 100%;
            height: 100%;
            display: block;
        }
        .box .enlarge{
            width: 450px;
            height: 450px;
            border: 3px solid;
            overflow: hidden;

            position: absolute;
            top: 0;
            left: 110%;
        }
        .box .enlarge img{
            position: absolute;
            top: 0;
            left: 0;
        }
    </style>
</head>
<body>
    <div class="box" id="box">
        <!-- 显示中等图片的区别 -->
        <div class="show">
            <!-- 显示的那个图片 -->
            <img src="./images/1.jpg" alt="">
            <!-- 蒙版(遮罩层) -->
            <div class="mask"></div>
        </div>
        <!-- 小图片列表区域 -->
        <div class="list">
            <p class="active"><img src="./images/1.small.jpg" data-m="./images/1.jpg" data-index="0" data-b="./images/1.big.jpg"></p>
            <p><img src="./images/2.small.jpg" data-index="1" data-m="./images/2.jpg" data-b="./images/2.big.jpg"></p>
        </div>
        <!-- 放大图片 -->
        <div class="enlarge">
            <!-- 显示的大图 -->
            <img src="./images/1.big.jpg" alt="">
        </div>
    </div>
    <!-- <script src="./enlarge.js"></script> -->
    <script src="./enlarge6.js"></script>
    <script>
        /* 
            面向就是对面向过程的一个高度的封装
        */
        /* /* 调用这个方法 */
        const e = new Enlarge("#box");
        e.init();
    </script>
</body>
</html>